﻿using SqlMapper.Serializers;
using System.Collections;
using System.Collections.Specialized;

namespace SqlMapper
{
    public class DeSerializerFactory
    {
        private IDictionary _serializerMap = new HybridDictionary();

        public DeSerializerFactory()
        {
            //_serializerMap.Add("dynamic", new DynamicDeSerializer());
            _serializerMap.Add("isEqual", new IsEqualDeSerializer());
            _serializerMap.Add("isNotEqual", new IsNotEqualDeSerializer());
            _serializerMap.Add("isGreaterEqual", new IsGreaterEqualDeSerializer());
            _serializerMap.Add("isGreaterThan", new IsGreaterThanDeSerializer());
            _serializerMap.Add("isLessEqual", new IsLessEqualDeSerializer());
            _serializerMap.Add("isLessThan", new IsLessThanDeSerializer());
            _serializerMap.Add("isNotEmpty", new IsNotEmptyDeSerializer());
            _serializerMap.Add("isEmpty", new IsEmptyDeSerializer());
            _serializerMap.Add("isNotNull", new IsNotNullDeSerializer());
            _serializerMap.Add("isNull", new IsNullDeSerializer());
            //_serializerMap.Add("isNotParameterPresent", new IsNotParameterPresentDeSerializer(configScope));
            //_serializerMap.Add("isNotPropertyAvailable", new IsNotPropertyAvailableDeSerializer(configScope));
            //_serializerMap.Add("isParameterPresent", new IsParameterPresentDeSerializer(configScope));
            //_serializerMap.Add("isPropertyAvailable", new IsPropertyAvailableDeSerializer(configScope));
            //_serializerMap.Add("iterate", new IterateSerializer(configScope));
        }

        /// <summary>
        /// 
        /// </summary>
        /// <param name="name"></param>
        /// <returns></returns>
        public IDeSerializer GetDeSerializer(string name)
        {
            return (IDeSerializer)_serializerMap[name];
        }
    }
}
